﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Ferry.Notification;

namespace Ferry.Silverlight.Test
{
	public partial class Page : UserControl
	{
		public Page()
		{
			InitializeComponent();

			NotifySystem ns = NotifySystem.GetNotifySystem("page");
			INotifyConnection conn = ns.Connect("notify", this, "OnNotifyButtonClick");

			conn.Available = true;
			conn.InvokePolicy = InvokePolicy.DirectlyInvoke;

		}



		private void NotifyButtonClick(object sender, RoutedEventArgs e)
		{
			NotifySystem ns = NotifySystem.GetNotifySystem("page");
			ns.Notify("notify", contentText.Text);
		}

		public void OnNotifyButtonClick(string message)
		{
			contentList.Items.Add(message);
		}

	
	}
}
